package web.suzy.oj.dao.msg.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import web.suzy.oj.dao.msg.MsgRemindEntityService;
import web.suzy.oj.mapper.MsgRemindMapper;
import web.suzy.oj.pojo.entity.msg.MsgRemind;
import web.suzy.oj.pojo.vo.UserMsgVO;
import web.suzy.oj.pojo.vo.UserUnreadMsgCountVO;

import javax.annotation.Resource;

/**
 * YangSuzy 软件工作室
 * 类名: MsgRemindEntityService
 * 描述: ---- 待定 -----
 * 功能: ---- 待定 -----
 *
 * @author YangSuzy
 * Date: 2022/11/18 12:35
 */
@Service
public class MsgRemindEntityServiceImpl extends ServiceImpl<MsgRemindMapper, MsgRemind> implements MsgRemindEntityService {

    @Resource
    private MsgRemindMapper msgRemindMapper;

    /**
     * 方法名: getUserUnreadMsgCount
     * 描述: 获取用户未读消息数
     *
     * @param uid 用户uuid
     * @return web.suzy.oj.pojo.vo.UserUnreadMsgCountVO
     * @date 2022/11/18 12:36
     * @auther YangSuzy
     **/
    @Override
    public UserUnreadMsgCountVO getUserUnreadMsgCount(String uid) {
        return msgRemindMapper.getUserUnreadMsgCount(uid);
    }

    /**
     * 方法名: getUserMsg
     * 描述: 分页查询用户消息
     *
     * @param page   分页对象
     * @param uid    用户uuid
     * @param action 消息类型
     * @return com.baomidou.mybatisplus.core.metadata.IPage<web.suzy.oj.pojo.vo.UserMsgVO>
     * @date 2022/11/18 12:37
     * @auther YangSuzy
     **/
    @Override
    public IPage<UserMsgVO> getUserMsg(Page<UserMsgVO> page, String uid, String action) {
        return msgRemindMapper.getUserMsg(page, uid, action);
    }
}
